#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <stdio.h>

int main()
{
    pid_t pid = fork();

    if (pid == 0)
    {
        sleep(3);
        printf("Child: pid=%d, ppid=%d\n", getpid(), getppid());
    }
    else
    {
        printf("Parent: Child pid=%d, pid=%d, ppid=%d\n", pid, getpid(), getppid());
        int status = 0;
        wait(&status);
        printf("wait success\n");
    }
    printf("In which process?,pid=%d\n", getpid());
}